/*-------------------------------------------------------------------------
   Copyright (C) 2010 One Laptop per Child

   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 2, or (at your option) any
   later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

   In other words, you are welcome to use, share and improve this program.
   You are forbidden to forbid anyone else to use, share and improve
   what you give them.   Help stamp out software-hoarding!

   As a special exception, you may use this file as part of a free software
   library for the XO of the One Laptop per Child project without restriction.
   Specifically, if other files instantiate
   templates or use macros or inline functions from this file, or you compile
   this file and link it with other files to produce an executable, this
   file does not by itself cause the resulting executable to be covered by
   the GNU General Public License.  This exception does not however
   invalidate any other reasons why the executable file might be covered by
   the GNU General Public License.
-------------------------------------------------------------------------*/

#ifndef EVENT_H
#define EVENT_H

#define EVENT_AC_CHANGE            1	// AC plugged/unplugged
#define EVENT_BATTERY_STATUS       2	// Battery low/full/error/gone
#define EVENT_BATTERY_CRITICAL     3	// Battery critical voltage
#define EVENT_BATTERY_SOC_CHANGE   4	// 1% SOC Change
#define EVENT_BATTERY_ERROR        5	// "Abnormal" error, query for cause
#define EVENT_POWER_PRESSED        6	// power button was pressed
#define EVENT_POWER_PRESS_WAKE     7	// power button pressed during sleep
#define EVENT_TIMED_HOST_WAKE      8	// Host wake timer
#define EVENT_OLS_HIGH_LIMIT       9	// OLS crossed dark threshold
#define EVENT_OLS_LOW_LIMIT       10	// OLS crossed light threshold

void event_init(void);
void event_send_event(unsigned char event);
void event_get_event_mask(void);
void event_set_event_mask(unsigned int);

void event_set_repeat(unsigned char event, int ms);
void event_process(void);

#endif

